package util.enumhelper;


import util.enumeration.OperatingHours;
import util.enumeration.Language;

public class LocalizedOperatingHours {

    // alphabetical order
    public static String getLocalizedOperatingHoursAsString(OperatingHours operatingHours, String locale) {
        String localizedOperatingHours = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedOperatingHours = getOperatingHours_EN_US(operatingHours);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedOperatingHours = getOperatingHours_EN_SG(operatingHours);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedOperatingHours = getOperatingHours_MS_MY(operatingHours);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedOperatingHours = getOperatingHours_ZH_CN(operatingHours);
        }
        // other language...
        else {
            localizedOperatingHours = getOperatingHours_EN_US(operatingHours);
        }
        
        return localizedOperatingHours;
    }
    
  // simplified chinese (zh_CN)
    private static String getOperatingHours_ZH_CN(OperatingHours operatingHours) {
        String localizedOperatingHours = "";
        
        switch (operatingHours) {
            case EightAM: localizedOperatingHours = "早上八点" ; break;
            case NineAM: localizedOperatingHours = "早上九点"; break;
            case TenAM: localizedOperatingHours = "早上十点"; break;
            case ElevenAM: localizedOperatingHours = "早上十一点"; break;
            case TwelvePM: localizedOperatingHours = "中午十二点"; break;
            case OnePM: localizedOperatingHours = "下午一点"; break;
            case TwoPM: localizedOperatingHours = "下午二点"; break;
            case ThreePM: localizedOperatingHours = "下午三点"; break;
            case FourPM: localizedOperatingHours = "下午四点"; break;
            case FivePM: localizedOperatingHours = "下午五点"; break;
            case SixPM: localizedOperatingHours = "下午六点"; break;
            case SevenPM: localizedOperatingHours = "晚上七点"; break;
            case EightPM: localizedOperatingHours = "晚上八点"; break;
            case NinePM: localizedOperatingHours = "晚上九  点"; break;
            case TenPM: localizedOperatingHours = "晚上十点"; break;
            case ElevenPM: localizedOperatingHours = "晚上十一点" ; break;
            case TwelveAM: localizedOperatingHours = "凌晨十二点"; break;
            case OneAM: localizedOperatingHours = "凌晨一点"; break;
            case TwoAM: localizedOperatingHours = "凌晨二点"; break;
            case ThreeAM: localizedOperatingHours = "凌晨三点"; break;
            case FourAM: localizedOperatingHours = "凌晨四点"; break;
            case FiveAM: localizedOperatingHours = "凌晨五点"; break;
            case SixAM: localizedOperatingHours = "凌晨六点"; break;
            case SevenAM: localizedOperatingHours = "凌晨七点"; break;
            case OFF: localizedOperatingHours = "休息"; break;
         }
        return localizedOperatingHours;
    }
    
    // default (en_US)
    private static String getOperatingHours_EN_US(OperatingHours operatingHours) {
        String localizedOperatingHours = "";
        
        switch (operatingHours) {
            case EightAM: localizedOperatingHours = "8:00am" ; break;
            case NineAM: localizedOperatingHours = "9:00am"; break;
            case TenAM: localizedOperatingHours = "10:00am"; break;
            case ElevenAM: localizedOperatingHours = "11:00am"; break;
            case TwelvePM: localizedOperatingHours = "12:00pm"; break;
            case OnePM: localizedOperatingHours = "1:00pm"; break;
            case TwoPM: localizedOperatingHours = "2:00pm"; break;
            case ThreePM: localizedOperatingHours = "3:00pm"; break;
            case FourPM: localizedOperatingHours = "4:00pm"; break;
            case FivePM: localizedOperatingHours = "5:00pm"; break;
            case SixPM: localizedOperatingHours = "6:00pm"; break;
            case SevenPM: localizedOperatingHours = "7:00pm"; break;
            case EightPM: localizedOperatingHours = "8:00pm"; break;
            case NinePM: localizedOperatingHours = "9:00pm"; break;
            case TenPM: localizedOperatingHours = "10:00pm"; break;
            case ElevenPM: localizedOperatingHours = "11:00pm" ; break;
            case TwelveAM: localizedOperatingHours = "12:00am"; break;
            case OneAM: localizedOperatingHours = "1:00am"; break;
            case TwoAM: localizedOperatingHours = "2:00am"; break;
            case ThreeAM: localizedOperatingHours = "3:00am"; break;
            case FourAM: localizedOperatingHours = "4:00am"; break;
            case FiveAM: localizedOperatingHours = "5:00am"; break;
            case SixAM: localizedOperatingHours = "6:00am"; break;
            case SevenAM: localizedOperatingHours = "7:00am"; break;
            case OFF: localizedOperatingHours = "OFF"; break;
         }
        return localizedOperatingHours;
    }
    
    // singapore english (en_SG)
    private static String getOperatingHours_EN_SG(OperatingHours operatingHours) {
             String localizedOperatingHours = "";
        
        switch (operatingHours) {
            case EightAM: localizedOperatingHours = "8:00am" ; break;
            case NineAM: localizedOperatingHours = "9:00am"; break;
            case TenAM: localizedOperatingHours = "10:00am"; break;
            case ElevenAM: localizedOperatingHours = "11:00am"; break;
            case TwelvePM: localizedOperatingHours = "12:00pm"; break;
            case OnePM: localizedOperatingHours = "1:00pm"; break;
            case TwoPM: localizedOperatingHours = "2:00pm"; break;
            case ThreePM: localizedOperatingHours = "3:00pm"; break;
            case FourPM: localizedOperatingHours = "4:00pm"; break;
            case FivePM: localizedOperatingHours = "5:00pm"; break;
            case SixPM: localizedOperatingHours = "6:00pm"; break;
            case SevenPM: localizedOperatingHours = "7:00pm"; break;
            case EightPM: localizedOperatingHours = "8:00pm"; break;
            case NinePM: localizedOperatingHours = "9:00pm"; break;
            case TenPM: localizedOperatingHours = "10:00pm"; break;
            case ElevenPM: localizedOperatingHours = "11:00pm" ; break;
            case TwelveAM: localizedOperatingHours = "12:00am"; break;
            case OneAM: localizedOperatingHours = "1:00am"; break;
            case TwoAM: localizedOperatingHours = "2:00am"; break;
            case ThreeAM: localizedOperatingHours = "3:00am"; break;
            case FourAM: localizedOperatingHours = "4:00am"; break;
            case FiveAM: localizedOperatingHours = "5:00am"; break;
            case SixAM: localizedOperatingHours = "6:00am"; break;
            case SevenAM: localizedOperatingHours = "7:00am"; break;
            case OFF: localizedOperatingHours = "OFF"; break;
         }
        return localizedOperatingHours;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getOperatingHours_MS_MY(OperatingHours operatingHours) {
              String localizedOperatingHours = "";
        
        switch (operatingHours) {
            case EightAM: localizedOperatingHours = "8:00am" ; break;
            case NineAM: localizedOperatingHours = "9:00am"; break;
            case TenAM: localizedOperatingHours = "10:00am"; break;
            case ElevenAM: localizedOperatingHours = "11:00am"; break;
            case TwelvePM: localizedOperatingHours = "12:00pm"; break;
            case OnePM: localizedOperatingHours = "1:00pm"; break;
            case TwoPM: localizedOperatingHours = "2:00pm"; break;
            case ThreePM: localizedOperatingHours = "3:00pm"; break;
            case FourPM: localizedOperatingHours = "4:00pm"; break;
            case FivePM: localizedOperatingHours = "5:00pm"; break;
            case SixPM: localizedOperatingHours = "6:00pm"; break;
            case SevenPM: localizedOperatingHours = "7:00pm"; break;
            case EightPM: localizedOperatingHours = "8:00pm"; break;
            case NinePM: localizedOperatingHours = "9:00pm"; break;
            case TenPM: localizedOperatingHours = "10:00pm"; break;
            case ElevenPM: localizedOperatingHours = "11:00pm" ; break;
            case TwelveAM: localizedOperatingHours = "12:00am"; break;
            case OneAM: localizedOperatingHours = "1:00am"; break;
            case TwoAM: localizedOperatingHours = "2:00am"; break;
            case ThreeAM: localizedOperatingHours = "3:00am"; break;
            case FourAM: localizedOperatingHours = "4:00am"; break;
            case FiveAM: localizedOperatingHours = "5:00am"; break;
            case SixAM: localizedOperatingHours = "6:00am"; break;
            case SevenAM: localizedOperatingHours = "7:00am"; break;
            case OFF: localizedOperatingHours = "DITUTUP"; break;
         }
        return localizedOperatingHours;
    }
}
